package com.extrace.model;

import com.google.gson.annotations.Expose;

import java.io.Serializable;

import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name = "TransPackageContent")
public class TransPackageContent implements Serializable {
    /**
     *
     */
    private static final long serialVersionUID = -2696910600791838998L;

    public TransPackageContent() {
    }

    @Expose
    private int SN;
    @Expose
    private ExpressSheet express;
    @Expose
    private TransPackage pkg;
    @Expose
    private int status;

    public void setSN(int SN) {
        this.SN = SN;
    }

    public int getSN() {
        return SN;
    }

    public void setExpress(ExpressSheet express) {
        this.express = express;
    }

    public ExpressSheet getExpress() {
        return express;
    }

    public void setPkg(TransPackage pkg) {
        this.pkg = pkg;
    }

    public TransPackage getPkg() {
        return pkg;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public int getStatus() {
        return status;
    }

    public String toString() {
        return toString(false);
    }

    public String toString(boolean idOnly) {
        if (idOnly) {
            return String.valueOf(getSN());
        }
        else {
            StringBuffer sb = new StringBuffer();
            sb.append("TransPackageContent[ ");
            sb.append("SN=").append(getSN()).append(" ");
            if (getExpress() != null)
                sb.append("Express.Persist_ID=").append(getExpress().toString(true)).append(" ");
            else
                sb.append("Express=null ");
            if (getPkg() != null)
                sb.append("Pkg.Persist_ID=").append(getPkg().toString(true)).append(" ");
            else
                sb.append("Pkg=null ");
            sb.append("]");
            return sb.toString();
        }
    }
    public static final class STATUS{
        public static final int STATUS_CREATE = 0;
        public static final int STATUS_PACKAGING = 1;
        public static final int STATUS_TRANSPORT = 2;
        public static final int STATUS_SORT = 3;
        public static final int STATUS_LANSHOU_PACKAGE = 4;
        public static final int STATUS_DELIVER_PACKAGE = 5;
    }
}
